/**
 * Copyright © 2011 Creativor Studio.
 * About license information), please see LICENSE.txt.
 */

package org.creativor.rayson.transport.common;

/**
 * Enumeration of all status codes of standard http protocol.
 * 
 * @author Nick Zhang
 */
public enum HttpStatusCode
{
	/**
	 * HTTP Status-Code 200: OK.
	 */
	OK(200),

	/**
	 * HTTP Status-Code 201: Created.
	 */
	CREATED(201),

	/**
	 * HTTP Status-Code 202: Accepted.
	 */
	ACCEPTED(202),

	/**
	 * HTTP Status-Code 203: Non-Authoritative Information.
	 */
	NOT_AUTHORITATIVE(203),

	/**
	 * HTTP Status-Code 204: No Content.
	 */
	NO_CONTENT(204),

	/**
	 * HTTP Status-Code 205: Reset Content.
	 */
	RESET(205),

	/**
	 * HTTP Status-Code 206: Partial Content.
	 */
	PARTIAL(206),

	/* 3XX: relocation/redirect */

	/**
	 * HTTP Status-Code 300: Multiple Choices.
	 */
	MULT_CHOICE(300),

	/**
	 * HTTP Status-Code 301: Moved Permanently.
	 */
	MOVED_PERM(301),

	/**
	 * HTTP Status-Code 302: Temporary Redirect.
	 */
	MOVED_TEMP(302),

	/**
	 * HTTP Status-Code 303: See Other.
	 */
	SEE_OTHER(303),

	/**
	 * HTTP Status-Code 304: Not Modified.
	 */
	NOT_MODIFIED(304),

	/**
	 * HTTP Status-Code 305: Use Proxy.
	 */
	USE_PROXY(305),

	/* 4XX: client error */

	/**
	 * HTTP Status-Code 400: Bad Request.
	 */
	BAD_REQUEST(400),

	/**
	 * HTTP Status-Code 401: Unauthorized.
	 */
	UNAUTHORIZED(401),

	/**
	 * HTTP Status-Code 402: Payment Required.
	 */
	PAYMENT_REQUIRED(402),

	/**
	 * HTTP Status-Code 403: Forbidden.
	 */
	FORBIDDEN(403),

	/**
	 * HTTP Status-Code 404: Not Found.
	 */
	NOT_FOUND(404),

	/**
	 * HTTP Status-Code 405: Method Not Allowed.
	 */
	BAD_METHOD(405),

	/**
	 * HTTP Status-Code 406: Not Acceptable.
	 */
	NOT_ACCEPTABLE(406),

	/**
	 * HTTP Status-Code 407: Proxy Authentication Required.
	 */
	PROXY_AUTH(407),

	/**
	 * HTTP Status-Code 408: Request Time-Out.
	 */
	CLIENT_TIMEOUT(408),

	/**
	 * HTTP Status-Code 409: Conflict.
	 */
	CONFLICT(409),

	/**
	 * HTTP Status-Code 410: Gone.
	 */
	GONE(410),

	/**
	 * HTTP Status-Code 411: Length Required.
	 */
	LENGTH_REQUIRED(411),

	/**
	 * HTTP Status-Code 412: Precondition Failed.
	 */
	PRECON_FAILED(412),

	/**
	 * HTTP Status-Code 413: Request Entity Too Large.
	 */
	ENTITY_TOO_LARGE(413),

	/**
	 * HTTP Status-Code 414: Request-URI Too Large.
	 */
	REQ_TOO_LONG(414),

	/**
	 * HTTP Status-Code 415: Unsupported Media Type.
	 */
	UNSUPPORTED_TYPE(415),

	/* 5XX: server error */

	/**
	 * HTTP Status-Code 500: Internal Server Error.
	 */
	INTERNAL_ERROR(500),

	/**
	 * HTTP Status-Code 501: Not Implemented.
	 */
	NOT_IMPLEMENTED(501),

	/**
	 * HTTP Status-Code 502: Bad Gateway.
	 */
	BAD_GATEWAY(502),

	/**
	 * HTTP Status-Code 503: Service Unavailable.
	 */
	UNAVAILABLE(503),

	/**
	 * HTTP Status-Code 504: Gateway Timeout.
	 */
	GATEWAY_TIMEOUT(504),

	/**
	 * HTTP Status-Code 505: HTTP Version Not Supported.
	 */
	VERSION(505);
	
	private int code;
	
	private HttpStatusCode(int code)
	{
		this.code = code;
	}
	
	/**
	 * @return the code
	 */
	public int getCode()
	{
		return code;
	}
}